package sdp;

/** Stores the state of a robot - either the player or the opponent:
 * 	- The robot's team;
 *  - The robot's position and rotation;
 *  - The robot's size.
 */
public class RobotState {
	/// The two possible teams in the game.
	public enum Team {
		YELLOW,
		BLUE
	}
	
	/** Construct a robot state, specifying all the information. */
	public RobotState( Team team, Vector2 size, Vector2 position, double rotation ) {
		assert size != null && position != null;
		
		this.team     = team;
		this.size     = size;
		this.position = position;
		this.rotation = rotation;
	}
	
	/// Get the team of this robot.
	public Team getTeam() {
		return team;
	}

	/// Get the robot's size.
	public Vector2 getSize() {
		return size;
	}
	
	/// Get the robot's position.
	public Vector2 getPosition() {
		return position;
	}
	
	/// Get the robot's rotation.
	public double getRotation() {
		return rotation;
	}
	
	/// Update the robot's position and rotation.
	public void update( Vector2 newPosition, double newRotation ) { 
		position = newPosition;
		rotation = newRotation;
	}
	
	private Team    team;
	private Vector2 position;
	private Vector2 size;
	private double  rotation;
}
